<template>
  <!-- <a-range-picker v-bind="attrs" @change="onChange" :style="{ width: props.width }" /> -->
  <a-date-picker
    v-model="pickerTimeValue"
    @change="onChange"
    placeholder="选择日期"
    :style="{ width: props.width }"
  />
</template>

<script lang="ts" setup>
    import { useAttrs, computed, ref, watch } from 'vue';
    import dayjs from 'dayjs';

    const pickerTimeValue = ref()
    const emit = defineEmits(['update:pickerTimeValue'])
    const props = defineProps({
        width: {
            type: String,
            default: '100%'
        }
    });
    const onChange = (dateString: any) => {
        if (dateString) {
            emit(
            'update:pickerTimeValue',
            // dayjs(dateString[0]).startOf('day').format('YYYY-MM-DD')
            dateString
            );
        }
    }
</script>